package web.dropwizard.mapper;


import util.jackson.serializer.InvalidJSONDocumentException;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;

/**
 * @author Gregory Boissinot
 */
public class InvalidJSONDocumentExceptionMapper implements ExceptionMapper<InvalidJSONDocumentException> {

    @Override
    public Response toResponse(InvalidJSONDocumentException exception) {
        return Response.status(Response.Status.BAD_REQUEST).entity(exception.getMessage()).build();
    }
}
